package com.tx.vuemybatisplusajax.service.serviceimpl;/*
 *
 * @author 陈粒
 * @version 创建时间：2021/8/28 15:49
 */


import com.tx.vuemybatisplusajax.mapper.UserMapper;
import com.tx.vuemybatisplusajax.pojo.User;
import com.tx.vuemybatisplusajax.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    //查询所有数据
    @Override
    public List<User> findall() {
        return userMapper.selectList(null);
    }

    //删除数据
    @Override
    public void deletebyid(Integer id) {
        userMapper.deleteById(id);
    }

    //插入数据
    @Override
    public void insertuser(User user) {
        userMapper.insert(user);
    }

    //更新数据
    @Override
    public void updatebyid(User user) {
        userMapper.updateById(user);
    }
}
